﻿using System.ComponentModel.Composition;
using Algoritmia.DataStructures.Lists;

namespace Demos.CoinChange
{
    [Export(typeof(IDemo))]
    class CoinChangeDemo : IDemo
    {
        public string Name { get; private set; }

        public CoinChangeDemo()
        {
            Name = "Coin Change";
        }

        public override string ToString()
        {
            return Name;
        }

        public void Execute()
        {
            var model = new Algoritmia.Problems.CoinChange.GreedyCoinChanger1(
                        new ArrayList<int> { 200, 100, 50, 20, 10, 5, 2, 1 });
            var vm = new ViewModel(model);
            var view = new View { DataContext = vm };
            view.Show();
        }
    }
}
